home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Mac OS 8.5 Updaters / RealPC⁄Soft Windows / SoftWindows / SoftWindows Upgrade Disk / INSIGNIA / DELREG_C.BAT < prev    next >
Encoding:
DOS Batch File  |  1998-08-24  |  1.3 KB  |  51 lines

  1. rem [
  2. rem    Name:        %M%
  3. rem
  4. rem    Derived from:    (original)
  5. rem
  6. rem    Author:        Clive Standbridge
  7. rem
  8. rem    Created on:    March 1998
  9. rem
  10. rem    Sccs ID:    %W% %G%
  11. rem
  12. rem    Coding Stds:    
  13. rem
  14. rem    Purpose:    Conditionally deletes Windows 95 registry key or value.
  15. rem
  16. rem    Parameters:    1    Parent key (must exist)
  17. rem            2    sub-key (may contain multiple key levels)
  18. rem            3    optional value name
  19. rem            regedit    As set by delreg.bat
  20. rem
  21. rem    Copyright 1998 Insignia Solutions PLC. All rights reserved.
  22. rem ]
  23.  
  24. %regedit% /e      c:\insignia\temp1.reg "%1"            >>c:\insignia\up.log
  25. find /i "[%1\%2]" c:\insignia\temp1.reg > nul:
  26. if errorlevel 1 goto end
  27.  
  28. rem  Sub-key exists
  29.  
  30. if not "%3" == "" goto delValue
  31.  
  32. rem  Delete entire sub-key
  33. echo Deleting registry key "%1\%2"                >>c:\insignia\up.log
  34. %regedit% /d                            "%1\%2"            >>c:\insignia\up.log
  35. goto end
  36.  
  37. :delValue
  38. %regedit% /e      c:\insignia\temp1.reg "%1\%2"            >>c:\insignia\up.log
  39. find /i /v """%3""=" < c:\insignia\temp1.reg > c:\insignia\temp2.reg
  40. if errorlevel 1 goto end
  41.  
  42. rem  Value exists
  43. echo Deleting registry value "[%1\%2]%3"            >>c:\insignia\up.log
  44. %regedit% /d                            "%1\%2"            >>c:\insignia\up.log
  45. %regedit%         c:\insignia\temp2.reg                >>c:\insignia\up.log
  46. echo.>>c:\insignia\up.log
  47.  
  48. :end
  49. del          c:\insignia\temp*.reg                >>c:\insignia\up.log
  50.  
  51.